<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 * 对输入的密码进行规则检查
 *
 * @access public
 * @param $secret 密码
 * @param $length 密码最小长度
 * @return array 
 */
if( ! function_exists('check_password_valid'))
{
    function check_password_valid($secret, $length = 8) {
        $score = 0;
        if(preg_match("/[0-9]{2,}/",$secret)){
            $score ++; 
        }
        if(preg_match("/[a-z]{2,}/",$secret)){
            $score ++; 
        }
        if(strlen($secret)>=$length){
            $score ++; 
        }
        return  $score; 
    }

}

/* End of file hyd_password_helper.php */
/* Location: ./application/helpers/hyd_password_helper.php */